[WFLY-22003] Replace JPA initialization with JDBC CDI bean - #1197
Conversation
luck3y
left a comment
There was a problem hiding this comment.
LGTM, I added some suggestions, feel free to disagree :)
|
Personally I dislike the usage of an EJB for this, I know this was suggested in the original JIRA but EJB is kind of legacy and considered an expensive resource, I suggest instead either:
Either requires no changes to the CLI script, or aditional dependencies. PS: Ken remarks would still need to be considered. |
|
Thank you @emmartins and @luck3y for your comments. I have since implemented everything, please let me know if everything is good or if changes need to be done. |
|
@Riovo please squash all commits into one too :) |
Hehe will do, thank you for you time :) |
|
LGTM overall, one non-blocking nit: Low risk given the small dataset, but |
Fixes: https://redhat.atlassian.net/browse/WFLY-22003
Replaces the current JPA-based database initialization with a CDI bean using direct JDBC. This eliminates the WildFly Glow unbound datasource warning that popped up because persistence.xml referenced a CLI-defined datasource.
The CDI bean observes application startup (@observes @initialized(ApplicationScoped.class)) to initialize the H2 database schema and test users for the Elytron JDBC realm.